#title "AppleScript" You can write macros in AppleScript, the system scripting language for the Macintosh, by placing Script Editor files in the Scripts folder.

The Scripts folder

The Scripts folder must be at the same level as #template.html file. Every site has its own Scripts folder, but it can be an alias to another folder. Any script you put in the Scripts folder can be called as a macro. As an example, there's a script called circumference in the scripts folder that ships with this package. That means I can call it from a web page as:
circumference (12) = {circumference (12)}
The name of the file must be an identifier, no spaces or non-alphanumeric characters. The name of the file must be the same as the name of the script it contains. The scripts are loaded into the user.html.macros table in Frontier. The macros are loaded every time a page is built. Do not edit the copies in Frontier, edit the originals using your favorite AppleScript editor.

Futures

This facility should already work with other OSA-compatible script interpreters. If anyone is working on one, please test this framework with your interpreter. OSA is a pretty good standard and worth supporting as we go forward.